<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('证书管理')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p>关键字：</p>
                                <input type="text" name="operator"/>
                            </li>
                            <li>
                                <p>参与单位：</p>
                                <input type="text" name="operator"/>
                            </li>
                            <li class="select-time">
									<label>上报日期范围： </label>
									<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
									<span>-</span>
									<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
								</li>
                            <li>
                            <li class="select-time">
									<label>发证日期范围： </label>
									<input type="text" class="time-input" id="startTime2" placeholder="开始时间" name="params[beginTime]"/>
									<span>-</span>
									<input type="text" class="time-input" id="endTime2" placeholder="结束时间" name="params[endTime]"/>
							</li>
                            <!-- <li>
							工程类型：<select name="projecttype" th:with="type=${@dict.getType('sys_normal_disable')}">
							            <option value="">全部</option>
										<option value="">私人住宅</option>
										<option value="">商品住宅</option>
										<option value="">廉租住房</option>
										<option value="">公共租赁住房</option>
										<option value="">经济适用住房</option>
										<option value="">限价商品住房</option>
										<option value="">城市棚户区改造安置房</option>
										<option value="">国有工矿棚户区改造安置房</option>
										<option value="">国有林场危旧房改造</option>
										<option value="">国有垦区危房改造</option>
										<option value="">公共建筑（医院，学校，剧场等）</option>
										<option value="">商住一体楼</option>
										<option value="">其他市政配套基础设施工程</option>
										<option value="">市政管线工程</option>
										<option value="">市政道路工程</option>
										<option value="">厂房</option>
										<option value="">装饰装修工程</option>
										<option value="">商铺</option>
										<option value="">商业写字楼</option>
										<option value="">其他</option>
								   </select>
							</li> -->
							<li>
							备案状态：<select name="projecttype" th:with="type=${@dict.getType('sys_normal_disable')}">
							            <option value="">全部</option>
										<option value="">已上报</option>
										<option value="">受理退回</option>
										<option value="">审查中</option>
										<option value="">审查退回</option>
										<option value="">审批通过</option>
								   </select>
							</li>
                            <li>
                                <!-- <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a> -->
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li> 
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                 <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
    var prefix = ctx + "supervise/completionRecordRecord";
    var prefixCertificate = ctx + "supervise/completionRecordCertificate";
    var prefixProject = ctx + "project/projectAll";
    var prefixEnterprise = ctx + "enterprise/enterpriseAll";
    
    $(function() {
    	var options = {
    			showSearch:false,
               	showRefresh:false,
               	showToggle:false,
               	showColumns:false,
    			url: prefixCertificate + "/list",
    			updateUrl: prefixCertificate + "/edit/{id}",
                detailUrl: prefixCertificate + "/detail/{id}",
                modalName: "竣工备案",
                columns: [ {
					    field : 'guid', 
					    title : '序号',
					    visible: false
					},
					{
					    field: 'id',
					    title: '序号',
					    width: 1,
					    formatter: function (value, row, index) {
					
					        return index + 1;
					    }
					}, 
					{
                        field: 'authorizeddate',
                        title: '审定日期',
                        width: 90
					},
					{
                        field: 'engineeringname',
                        title: '工程名称',
                        width: 500,
                        formatter: function (value, row, index) {
                            var actions = [];
                            //actions.push('<a href="'+prefix+'/detail?engineeringname='+value+'">'+value+'</a>'); 
                            //actions.push('<a href="javascript:void(0)" onclick="$.operate.detailFull(\'' + row.id + '\')">'+value+'</a>');
                            actions.push('<a href="javascript:void(0)" onclick="$.operate.detail(\'' + value + '\')">'+value+'</a> ');
                            return actions.join('');
                        }
                    },
                    {
                        field: 'projectinfoguid',
                        title: '项目名称',
                        width: 110,
                        formatter: function (value, row, index) {
                            var actions = [];
                            actions.push('<a href="'+prefixProject+'/detail?name='+value+'">'+value+'</a>');
                            return actions.join('');
                        }
                    },
                    {
                        field: 'constructunit',
                        title: '建设单位',
                        width: 200,
                        formatter: function (value, row, index) {
                            var actions = [];
                            actions.push('<a href="'+prefixEnterprise+'/detail?name='+value+'">'+value+'</a>');
                            return actions.join('');
	                    }
                    },
                    {
	                    field: 'opera',
	                    title: '操作',
                        formatter: function (value, row, index) {
                            var actions = [];
                            actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)"><i class="fa fa-download"></i>打印</a> ');
                            actions.push('<a class="btn btn-primary single btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.engineeringname + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                            actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.engineeringname + '\')"><i class="fa fa-plus"></i>查看</a> ');
                            return actions.join('');
	                       }
	                }
                ]
    	    }
    	$.table.init(options);
    });
    </script>
</body>
</html>